<%
    def varDomainName=tableNameUtil.lowerCaseFirst(tableDefine.id);
    def pkColumn=tableDefine.getPkColumn();
    def pkJavaType=tableNameUtil.getDataType(pkColumn?.columnType);

%>package ${config.basePackage}.service.${config.category}.impl;

import ${config.basePackage}.service.${config.category}.${tableDefine.id}Service;
import ${config.basePackage}.mapper.${config.category}.${tableDefine.id}Mapper;
import ${config.basePackage}.model.${config.category}.${tableDefine.id};
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * ${tableDefine.cnname}service实现
 *
 * @author ${config.author}
 * @date ${config.nowDate}
 *
 */
@Service
public class ${tableDefine.id}ServiceImpl implements ${tableDefine.id}Service {

	@Resource
	private ${tableDefine.id}Mapper ${varDomainName}Mapper;

    /**
     * 增加
     *
     * @param ${varDomainName}
     * @return
     */
    @Override
    public int insert(${tableDefine.id} ${varDomainName}) {
            return ${varDomainName}Mapper.insert(${varDomainName});
        }

    /**
     * 有选择的增加
     *
     * @param ${varDomainName}
     * @return
     */
    @Override
    public int insertSelective(${tableDefine.id} ${varDomainName}) {
            return ${varDomainName}Mapper.insertSelective(${varDomainName});
        }

    /**
     * 根据主键删除${tableDefine.id}
     *
     * @param ${pkColumn.dataName}
     */
    @Override
    public int deleteByPrimaryKey(${pkJavaType} ${pkColumn.dataName}) {
            return ${varDomainName}Mapper.deleteByPrimaryKey(${pkColumn.dataName});
        }

    /**
     * 更新${tableDefine.id}
     *
     * @param ${varDomainName}
     */
    @Override
    public int updateByPrimaryKey(${tableDefine.id} ${varDomainName}) {
            return ${varDomainName}Mapper.updateByPrimaryKey(${varDomainName});
        }

    /**
     * 有选择的更新${tableDefine.id}
     *
     * @param ${varDomainName}
     */
    @Override
    public int updateByPrimaryKeySelective(${tableDefine.id} ${varDomainName}) {
            return ${varDomainName}Mapper.updateByPrimaryKeySelective(${varDomainName});
        }

    /**
     * 根据主键查询${tableDefine.id}
     *
     * @param ${pkColumn.dataName}
     * @return
     */
    @Override
    public ${tableDefine.id} selectByPrimaryKey(${pkJavaType} ${pkColumn.dataName}) {
            return ${varDomainName}Mapper.selectByPrimaryKey(${pkColumn.dataName});
        }

    /**
     * 分页查询${tableDefine.id}
     *
     * @param ${varDomainName}
     */
    @Override
    public PageList<${tableDefine.id}> selectListBySelective(${tableDefine.id} ${varDomainName}, PageBounds pageBounds) {
            return ${varDomainName}Mapper.selectListBySelective(${varDomainName}, pageBounds);
        }

}
